<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%
	String path = request.getContextPath();
	String basePath = request.getScheme() + "://" + request.getServerName() + ":" + request.getServerPort()
			+ path + "/";
%>

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<base href="<%=basePath%>">

<title>My JSP 'questions.jsp' starting page</title>

<meta http-equiv="pragma" content="no-cache">
<meta http-equiv="cache-control" content="no-cache">
<meta http-equiv="expires" content="0">
<meta http-equiv="keywords" content="keyword1,keyword2,keyword3">
<meta http-equiv="description" content="This is my page">
<!--
	<link rel="stylesheet" type="text/css" href="styles.css">
	-->
<style type="text/css">
.head {
	text-align: center;
}

td, th {
	white-space: nowrap;
}
</style>
<script type="text/javascript">
	function verify() {
		var res = document.getElementById("title").value;
		if (res == "") {
			alert("必须填写问题");
			return false;
		} else {
			return true;
		}

	}
</script>

</head>

<body>
	<h1 class="head">我要提问</h1>
	<p class="head">
		<a href="index.jsp">返回首页</a>
	</p>
	<form action="doSave.jsp" method="post" onsubmit="return verify()">
		<table style="margin:auto">
			<tr>
				<td>问题：</td>
				<td><input text="text" name="title" id="title"></td>
			</tr>
			<tr>
				<td>问题描述：</td>
				<td><textarea name="detaidDesc"></textarea></td>
			</tr>
			<tr>
				<td colspan="2" align="center"><input type="submit"
					value="保存问题"> </textarea></td>
			</tr>
		</table>
	</form>
</body>
</html>
